home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume5 / xpclock / patch1 < prev    next >
Encoding:
Internet Message Format  |  1989-11-29  |  5.7 KB

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v05i034: xpclock, Patch1
  5. Message-ID: <1219@island.uu.net>
  6. Date: 30 Nov 89 05:00:41 GMT
  7. Sender: news@island.uu.net
  8. Organization: Island Graphics, Marin County, California
  9. Lines: 184
  10. Approved: island!argv@sun.com
  11.  
  12. Submitted-by: uunet!kddlab!isl.yamaha.co.jp!shutoh (Kazuhiko Shutoh)
  13. Posting-number: Volume 5, Issue 34
  14. Archive-name: xpclock/patch1
  15. Patch-To: xpclock: Volume 5, Issue 25
  16.  
  17. The following shell archive contains new files and patch for xpclock.
  18. This patch makes more realistic movement pendulum.
  19.  
  20. Many thanks to Sjaak Schilperoort(JW_Schilperoort@pttrnl.nl).
  21.  
  22.                 Kazuhiko Shutoh
  23.                                 shutoh%isl.yamaha.co.jp%kddlab@uunet.uu.net
  24.  
  25. ----- CUT HERE ----- CUT HERE ----- CUT HERE ----- CUT HERE ----- CUT HERE --
  26. #! /bin/sh
  27. # This is a shell archive.  Remove anything before this line, then unpack
  28. # it by saving it into a file and typing "sh file".  To overwrite existing
  29. # files, type "sh file -c".  You can also feed this as standard input via
  30. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  31. # will see the following message at the end:
  32. #        "End of shell archive."
  33. # Contents:  README.patch1 patchlevel.h xpclock.patch1
  34. # Wrapped by shutoh@shako on Wed Nov 29 15:17:11 1989
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. if test -f 'README.patch1' -a "${1}" != "-c" ; then 
  37.   echo shar: Will not clobber existing file \"'README.patch1'\"
  38. else
  39. echo shar: Extracting \"'README.patch1'\" \(274 characters\)
  40. sed "s/^X//" >'README.patch1' <<'END_OF_FILE'
  41. XSCCS ID : @(#)README.patch1    1.1   11/29/89
  42. X
  43. X
  44. X        xpclock official patch #1
  45. X
  46. X
  47. XThis patch was proposal by Sjaak Schilperoort.(JW_Schilperoort@pttrnl.nl).
  48. XSuppose apply this patch, more realistic movement pendulum.
  49. X
  50. XMany, many thanks to Sjaak.
  51. X
  52. X                            Kazuhiko Shutoh       
  53. X
  54. X
  55. X    
  56. END_OF_FILE
  57. if test 274 -ne `wc -c <'README.patch1'`; then
  58.     echo shar: \"'README.patch1'\" unpacked with wrong size!
  59. fi
  60. # end of 'README.patch1'
  61. fi
  62. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  63.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  64. else
  65. echo shar: Extracting \"'patchlevel.h'\" \(628 characters\)
  66. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  67. X/*
  68. X*   SCCS ID : @(#)patchlevel.h    1.1  11/29/89
  69. X* 
  70. X*   patchlevel.h - Patch level maintenance header
  71. X*
  72. X*   Author: Kazuhiko Shutoh, 1989.
  73. X*
  74. X*   Permission to use, copy, modify and distribute without charge this
  75. X*   software, documentation, images, etc. is granted, provided that this 
  76. X*   comment and the author's name is retained.  The author assumes no 
  77. X*   responsibility for lost sleep as a consequence of use of this software.
  78. X*
  79. X*   Send any comments, bug reports, etc. to: shutoh@isl.yamaha.co.jp or, 
  80. X*   for oversea: shutoh%isl.yamaha.co.jp%kddlab@uunet.uu.net  
  81. X*                              
  82. X*/
  83. X
  84. X#define PATCHLEVEL 1
  85. END_OF_FILE
  86. if test 628 -ne `wc -c <'patchlevel.h'`; then
  87.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  88. fi
  89. # end of 'patchlevel.h'
  90. fi
  91. if test -f 'xpclock.patch1' -a "${1}" != "-c" ; then 
  92.   echo shar: Will not clobber existing file \"'xpclock.patch1'\"
  93. else
  94. echo shar: Extracting \"'xpclock.patch1'\" \(2217 characters\)
  95. sed "s/^X//" >'xpclock.patch1' <<'END_OF_FILE'
  96. Xdiff -c ../old/Imakefile ./Imakefile
  97. X*** ../old/Imakefile    Wed Nov 29 14:32:24 1989
  98. X--- ./Imakefile    Wed Nov 29 14:33:02 1989
  99. X***************
  100. X*** 1,4 ****
  101. X! #   SCCS ID : @(#)Imakefile    1.5   11/11/89
  102. X  #
  103. X  #   Imakefile - Imakefile for xpclock
  104. X  # 
  105. X--- 1,4 ----
  106. X! #   SCCS ID : @(#)Imakefile    1.6   11/29/89
  107. X  #
  108. X  #   Imakefile - Imakefile for xpclock
  109. X  # 
  110. X***************
  111. X*** 24,30 ****
  112. X  #CC = gcc
  113. X  CC = cc
  114. X  
  115. X! #DEBUGFLAGS = -g
  116. X  CDEBUGFLAGS = -O
  117. X  
  118. X  ComplexProgramTarget(xpclock)
  119. X--- 24,30 ----
  120. X  #CC = gcc
  121. X  CC = cc
  122. X  
  123. X! #CDEBUGFLAGS = -g
  124. X  CDEBUGFLAGS = -O
  125. X  
  126. X  ComplexProgramTarget(xpclock)
  127. XOnly in .: README.patch1
  128. XOnly in .: patchlevel.h
  129. Xdiff -c ../old/xpclock.c ./xpclock.c
  130. X*** ../old/xpclock.c    Wed Nov 29 14:32:26 1989
  131. X--- ./xpclock.c    Wed Nov 29 14:33:32 1989
  132. X***************
  133. X*** 1,4 ****
  134. X! static char     sccsid[] = "@(#)xpclock.c    1.7   11/1/89";
  135. X  /*
  136. X   * xpclock.c - Pendulum Clock for X11
  137. X   * 
  138. X--- 1,4 ----
  139. X! static char     sccsid[] = "@(#)xpclock.c    1.8   11/29/89";
  140. X  /*
  141. X   * xpclock.c - Pendulum Clock for X11
  142. X   * 
  143. X***************
  144. X*** 27,32 ****
  145. X--- 27,33 ----
  146. X  
  147. X  #include "xpclock.h"
  148. X  #include "xpclock.icon"
  149. X+ #include "patchlevel.h"
  150. X  
  151. X  XtTimerCallbackProc MovePendulum();
  152. X  XtCallbackProc  RedrawPendulum();
  153. X***************
  154. X*** 159,164 ****
  155. X--- 160,166 ----
  156. X      static double   old_pendulum_theta;
  157. X      static int      old_pendulum_x = 0;
  158. X      static int      old_pendulum_y = 0;
  159. X+     static int    pendulum_moment_count = 0;
  160. X  
  161. X      if ((pendulum_x != 0) && (pendulum_y != 0)) {
  162. X          old_pendulum_theta = pendulum_theta;
  163. X***************
  164. X*** 165,175 ****
  165. X          old_pendulum_x = pendulum_x;
  166. X          old_pendulum_y = pendulum_y;
  167. X      }
  168. X-     if ((pendulum_theta + pendulum_vector < 0) ||
  169. X-         (pendulum_theta + pendulum_vector > 45))
  170. X-         pendulum_vector = -pendulum_vector;
  171. X  
  172. X!     pendulum_theta += (double) pendulum_vector;
  173. X  
  174. X      XtSetArg(args[0], XtNheight, 0);
  175. X      XtSetArg(args[1], XtNwidth, 0);
  176. X--- 167,176 ----
  177. X          old_pendulum_x = pendulum_x;
  178. X          old_pendulum_y = pendulum_y;
  179. X      }
  180. X  
  181. X!     pendulum_theta = (22.5 * sin((double)pendulum_moment_count * 2 
  182. X!                             * PI / 45) + 22.5);
  183. X!     pendulum_moment_count++;
  184. X  
  185. X      XtSetArg(args[0], XtNheight, 0);
  186. X      XtSetArg(args[1], XtNwidth, 0);
  187. XOnly in .: xpclock.patch1
  188. END_OF_FILE
  189. if test 2217 -ne `wc -c <'xpclock.patch1'`; then
  190.     echo shar: \"'xpclock.patch1'\" unpacked with wrong size!
  191. fi
  192. # end of 'xpclock.patch1'
  193. fi
  194. echo shar: End of shell archive.
  195. exit 0
  196.